package com.vunguyen.model;
// Generated Dec 28, 2014 10:51:48 PM by Hibernate Tools 3.6.0


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * PhancongcongvandenGiangvien generated by hbm2java
 */
@Entity
@Table(name="phancongcongvanden_giangvien"
    ,catalog="qlkhoacntt"
)
public class PhancongcongvandenGiangvien  implements java.io.Serializable {


     private int idPhanCong;
     private Giangvien giangvien;
     private Phancongcongvanden phancongcongvanden;

    public PhancongcongvandenGiangvien() {
    }

    public PhancongcongvandenGiangvien(Giangvien giangvien, Phancongcongvanden phancongcongvanden) {
       this.giangvien = giangvien;
       this.phancongcongvanden = phancongcongvanden;
    }
   
     @GenericGenerator(name="generator", strategy="foreign", parameters=@Parameter(name="property", value="phancongcongvanden"))@Id @GeneratedValue(generator="generator")

    
    @Column(name="idPhanCong", unique=true, nullable=false)
    public int getIdPhanCong() {
        return this.idPhanCong;
    }
    
    public void setIdPhanCong(int idPhanCong) {
        this.idPhanCong = idPhanCong;
    }

@ManyToOne(fetch=FetchType.EAGER)
    @JoinColumn(name="idCanBo", nullable=false)
    public Giangvien getGiangvien() {
        return this.giangvien;
    }
    
    public void setGiangvien(Giangvien giangvien) {
        this.giangvien = giangvien;
    }

@OneToOne(fetch=FetchType.EAGER)@PrimaryKeyJoinColumn
    public Phancongcongvanden getPhancongcongvanden() {
        return this.phancongcongvanden;
    }
    
    public void setPhancongcongvanden(Phancongcongvanden phancongcongvanden) {
        this.phancongcongvanden = phancongcongvanden;
    }




}


